package com.wl2o2o.writtenview.mt;

import java.util.Scanner;

/**
 * @Author <a href="https://github.com/wl2o2o">程序员CSGUIDER</a>
 * @From <a href="https://wl2o2o.github.io">CSGUIDER博客</a>
 * @CreateTime 2024/3/16
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            // 前缀和数组记录合计价格
            long[] ai = new long[n+1];

            for (int i = 0; i < n; i++) {
                ai[i+1] = ai[i] + in.nextLong();
                // System.out.println(ai[i+1]);
            }
            long x = in.nextLong();
            long y = in.nextLong();
            System.out.println(ai[n] - x - y);


        }
    }
}